Repository navigation
fix(repo-dvp): release the borrower's leg-2 due in default_at_maturity - #1281
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
accept_and_settleapproves the running sum of a borrower's outstanding leg-2 ceilings (DataKey::BorrowerDue), and each closing path takes its trade's ceiling back out withrelease_borrower_due.unwindanddefault_closedid this;default_at_maturitydid not. A trade defaulted at maturity therefore stayed counted, and the borrower's next settle approved more than they owed.default_at_maturitynow callsrelease_borrower_dueafter it writes the defaulted trade, like the other two paths.Changes
contracts/repo-dvp/src/lib.rs: release the trade's share ofBorrowerDueindefault_at_maturity.contracts/repo-dvp/src/test.rs:default_at_maturity_releases_the_trades_share_of_the_borrowers_due.contracts/AUDIT_NOTES.md: the RepoDvP note that listed this as a gap now says all three closing paths release the due.Checks run
cargo test -p ballast-repo-dvp default_at_maturity(9 passed)🤖 Generated with Claude Code